package com.itheima.service.setmeal.impl;

import com.itheima.entity.Setmeal;
import com.itheima.mapper.SetmealMapper;
import com.itheima.service.setmeal.SetmealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class SetmealServiceImpl implements SetmealService {
    @Autowired
    private SetmealMapper setmealMapper;
    @Override
    @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)//开启事务
    public List<Setmeal> findAll() {
        return setmealMapper.findAll();
    }
}
